<?php

/**
 * LEAGUEMan
 * 
 * Copyright (C) 2007 Marko Bischof
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
defined('_VALID_MOS') or die('Direct Access to this location is not allowed.');

require_once( $mainframe->getPath('toolbar_default') );

switch ($act) {

    case "leaguetable":
        mosMenuBar::startTable();
        mosMenuBar::divider();
        mosMenuBar::endTable();
        break;

    case "matrix":
        break;

    case "lineup":
    default:
        mosMenuBar::startTable();
        mosMenuBar::save("save");
        mosMenuBar::spacer();
        mosMenuBar::cancel("cancel");
        mosMenuBar::endTable();
        break;
        break;

    case "matches":
        switch ($task) {

            default:
                mosMenuBar::startTable();
                mosMenuBar::custom("setcurrent", "forward.png", "forward_f2.png", "Current", false);
                mosMenuBar::spacer();
                mosMenuBar::divider();
                mosMenuBar::spacer();
                mosMenuBar::publishList();
                mosMenuBar::spacer();
                mosMenuBar::unpublishList();
                mosMenuBar::spacer();
                mosMenuBar::divider();
                mosMenuBar::spacer();
                mosMenuBar::deleteList("", "remove");
                mosMenuBar::endTable();
                break;

            case "edit":
                mosMenuBar::startTable();
                mosMenuBar::save("save");
                mosMenuBar::spacer();
                mosMenuBar::cancel("cancel");
                mosMenuBar::endTable();
                break;
        }
        break;

    case "playermap":
        switch ($task) {

            default:
                mosMenuBar::startTable();
                mosMenuBar::custom("unassign", 'delete.png', 'delete_f2.png', 'Unassign');
                mosMenuBar::spacer();
                mosMenuBar::custom("reset", 'cancel.png', 'cancel_f2.png', 'Reset');
                mosMenuBar::endTable();
                break;

            case "edit":
                mosMenuBar::startTable();
                mosMenuBar::save("save");
                mosMenuBar::spacer();
                mosMenuBar::cancel("cancel");
                mosMenuBar::endTable();
                break;
        }
        break;

    case 'events':
        switch ($task) {
            case 'edit':
                mosMenuBar::startTable();
                mosMenuBar::save("save");
                mosMenuBar::spacer();
                mosMenuBar::cancel("cancel");
                mosMenuBar::endTable();
                break;

            default:
                mosMenuBar::startTable();
                mosMenuBar::deleteList("", "deleteconfirm");
                mosMenuBar::endTable();
                break;
        }
        break;

    default:
        switch ($task) {

            case "new":
            case "edit":
                mosMenuBar::startTable();
                mosMenuBar::save("save");
                mosMenuBar::spacer();
                mosMenuBar::cancel("cancel");
                mosMenuBar::endTable();
                break;

            default:
                mosMenuBar::startTable();
                mosMenuBar::publishList();
                mosMenuBar::spacer();
                mosMenuBar::unpublishList();
                mosMenuBar::spacer();
                mosMenuBar::divider();
                mosMenuBar::spacer();
                mosMenuBar::addNew("new");
                mosMenuBar::spacer();
                mosMenuBar::editList("edit");
                mosMenuBar::spacer();
                mosMenuBar::custom("copy", "copy.png", "copy_f2.png", "Copy");
                mosMenuBar::spacer();
                mosMenuBar::divider();
                mosMenuBar::spacer();
                mosMenuBar::deleteList("", "deleteconfirm");
                mosMenuBar::endTable();
                break;
        }
        break;

    case "teammap":
        switch ($task) {

            case "edit":
                mosMenuBar::startTable();
                mosMenuBar::save("save");
                mosMenuBar::spacer();
                mosMenuBar::cancel("cancel");
                mosMenuBar::endTable();
                break;

            default:
                mosMenuBar::startTable();
                mosMenuBar::custom("unassign", 'delete.png', 'delete_f2.png', 'Unassign');
                mosMenuBar::endTable();
                break;
        }
        break;

    case "leagues":
    case "seasons":
    case "positions":
    case "teams":
    case "rounds":
    case "players":
    case "clubs":
    case "contacts":

        switch ($task) {

            default:
                mosMenuBar::startTable();
                if (in_array($act, array("players", "teams"))) {
                    mosMenuBar::custom("assign", "copy.png", "copy_f2.png", "Assign");
                    mosMenuBar::spacer();
                    mosMenuBar::divider();
                    mosMenuBar::spacer();
                    mosMenuBar::custom("bulkadd", "new.png", "new_f2.png", "Bulkadd", false);
                    mosMenuBar::spacer();
                }

                if ($act == "clubs") {
                    mosMenuBar::custom("bulkadd", "new.png", "new_f2.png", "Bulkadd", false);
                    mosMenuBar::spacer();
                }

                if ($act == "teams") {
                    mosMenuBar::custom("createClubs", "new.png", "new_f2.png", "ClubGen", false);
                    mosMenuBar::spacer();
                    mosMenuBar::divider();
                    mosMenuBar::spacer();
                }

                if ($act == "rounds") {
                    mosMenuBar::custom("createarticle", "new.png", "new_f2.png", "ArticleGen");
                    mosMenuBar::spacer();
                    mosMenuBar::divider();
                    mosMenuBar::spacer();
                }

                mosMenuBar::addNew("new");
                mosMenuBar::spacer();
                mosMenuBar::editList("edit");
                mosMenuBar::spacer();
                mosMenuBar::deleteList("", "remove");
                mosMenuBar::endTable();
                break;

            case "new":
            case "edit":
                mosMenuBar::startTable();
                mosMenuBar::save("save");
                mosMenuBar::spacer();
                mosMenuBar::cancel("cancel");
                mosMenuBar::endTable();
                break;

            case "bulkadd":
                mosMenuBar::startTable();
                mosMenuBar::custom("bulksave", "save.png", "save_f2.png", "Save", false);
                mosMenuBar::spacer();
                mosMenuBar::cancel("cancel");
                mosMenuBar::endTable();
                break;
        }
        break;
}